<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="css/lib/bootstrap.min.css"/>
		<script src="js/lib/jquery-1.11.0.js"></script>
		<script src="js/lib/bootstrap.min.js"></script>
		<script src="js/lib/angular.min.js"></script>
		<script src="js/base.js" type="text/javascript" charset="utf-8"></script>
	</head>
	 <style>
	 	body{
			font-size:15px;
		}
	 	table,
		th,
		td {
			border: 1px solid grey;
			border-collapse: collapse;
			padding: 5px;
			vertical-align: middle !important;
		}		
		table td:nth-child(even) {
			
		}
		table tr:nth-child(2) {
			background-color:#f1f1f1;
		}
		input{
			width:280px;
		}
		span{
			width:20px;color:red;display:inline-block;text-align:center;
		}
		#sho{
			width:300px;
			height:50px;
			background:#d9534f;
			opacity:0.8;
			border-radius:8px;
			color:#fff;
			text-align: center;
			font-size:30px;
			position: absolute;
			top:0px;
			left:550px;
			display:none;
		}
	 </style>
	<body ng-app="myApp" ng-controller="customersCtrl">
		<div class="">
			<div id="sho" ng-show="kk"></div>
		
			<div style="padding:15px 5px 0px 5px;border:3px solid #ccc;margin-bottom:15px">
			<table class="table table-hover">				
				<tbody>
					<tr>
						<th colspan="9" style="font-size:26px;color:#337ab7"">三级分销返佣比例查询：</th>
					</tr>
					<tr>
						<td colspan="3" class="text-center">品牌编号查询三级分销比率：</td>
						<td colspan="3">
							<!--下拉框在此不实用 改为input-->
							<!--<select style="width:280px;" ng-model="input1" placeholder="请输入品牌编号" class="form-control" ng-change="query1()">
								<option value="">请选择</option>
								<option value="1">赚到钱包</option>
							</select>-->
							<input type="text" value="1" placeholder="赚道钱包" style="width:280px;" ng-model="input1" class="form-control">
						</td>
						<td colspan="3">
							<button id="btn" style="display: block;margin:0 auto" ng-click="vv()" class="btn btn-danger">查询</button>
						</td>
					</tr>
					<tr>
						<td style="width:60px;" class="text-center">序号</td>
						<td class="text-center">品牌</td>
						<!--<td class="text-center">产品ID</td>-->
						<td class="text-center">名称</td>
						<td class="text-center">代理级别</td>
						<td class="text-center">比率</td>
						<td class="text-center">折扣</td>
						<td class="text-center">备注</td>
						<td class="text-center">时间</td>
					</tr>
					<tr id="show" ng-repeat="item in lists">
						<td class="text-center">{{$index+1}}</td>
						<td class="text-center">{{item.brandId | modify:item.brandId}}</td>
						<!--<td class="text-center">{{item.id}}</td>-->
						<td class="text-center">{{"-"}}</td>
						<td class="text-center">{{item.preLevel | modify2:item.preLevel}}</td>
						<td style="color:red" class="text-center">{{item.ratio}}</td>
						<td class="text-center">{{"-"}}</td>
						<td class="text-center">{{"-"}}</td>
						<td class="text-center">{{item.createTime}}</td>
					</tr>
					<tr>
						<td colspan="9" id="show01" class="text-center">
							总共{{3}}条数据
						</td>
					</tr>
				</tbody>
			</table>		
		</div>
		</div>
	</body>
	
	<script>
		var app = angular.module('myApp', []);
	   /*自定义过滤器   1*/
		app.filter("modify",function(){
			return function(input,param){
				if(param == 1){
					return param = "赚道钱包"
				}
				input = param
				return input
			}
		})
		/*自定义过滤器   2*/
		app.filter("modify2",function(){
			return function(input,param){
				if(param == 1){
					return param = "分销商"
				}
				if(param == 2){
					return param = "代理商"
				}
				if(param == 3){
					return param = "服务商"
				}
				input = param
				return input
			}
		})
        app.controller('customersCtrl', function($scope, $http ){        	
        	
			/*按品牌查询所有三级分销比率*/
			$scope.query1 = function(){

			}
			
			$scope.vv = function(){
                var brand = $scope.input1
                    $http({
                        method:'GET',
                        url: window.baseUrl+"user/thirdlevel/ratio/query/"+1,
                    }).then(function successCallback(data){
                        console.log("查询所有三级分销比率成功...")
                        console.log(data)
                        $scope.lists = data.data.result
                    }, function errorCallback(data){
                        console.log("查询所有三级分销比率失败...")
                        console.log(data)
                    })

                $scope.input = ""
			}
        })
	</script>
</html>

